<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
  <title>人事管理系统</title>
  <style>
    body { font-family: Arial, sans-serif; margin: 20px; }
    h2 { border-bottom: 2px solid #ccc; padding-bottom: 10px; }
    table { width: 100%; border-collapse: collapse; margin-top: 15px; }
    th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
    th { background-color: #f5f5f5; }
    tr.odd { background-color: #f9f9f9; } /* 隔行变色 */
    tr.even { background-color: #ffffff; }
    .button { margin-top: 20px; display: inline-block; padding: 8px 16px; background-color: #4CAF50; color: white; text-decoration: none; }
  </style>
</head>
<body>
<h2>人员列表</h2>
<table>
  <tr>
    <th>编号</th>
    <th>姓名</th>
    <th>性别</th>
    <th>年龄</th>
    <th>等级</th>
    <th>部门</th>
    <th>操作</th>
  </tr>
  <c:forEach items="${personList}" var="person" varStatus="status">
    <tr class="${status.index % 2 == 0 ? 'even' : 'odd'}">
      <td>${person.id}</td>
      <td>${person.name}</td>
      <td>${person.sex}</td>
      <td>${person.age}</td>
      <td>${person.rank}</td>
      <td>${person.department}</td>
      <td>
        <a href="hrAction.do?action=delete&id=${person.id}"
           onclick="return confirm('确认删除吗?')">删除</a>
      </td>
    </tr>
  </c:forEach>
</table>
<a href="add.jsp" class="button">添加人员</a>
</body>
</html>